package com.zahb.qadx.model;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Zdw on 2020/10/09 10:40
 */
public class DataLogin {

    private List<Org> orgList;
    private int currentOrg;
    private User user;
    private String token;

    public List<Org> getOrgList() {
        return orgList != null ? orgList : new ArrayList<>();
    }

    public void setOrgList(List<Org> orgList) {
        this.orgList = orgList;
    }

    public int getCurrentOrg() {
        if (currentOrg <= 0) {
            if (orgList != null && orgList.size() > 0) {
                currentOrg = orgList.get(0).getRootOrgId();
            }
        }
        return currentOrg;
    }

    public void setCurrentOrg(int currentOrg) {
        this.currentOrg = currentOrg;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
